package com.graph.factory;

import com.graph.impl.ProbabilityModelGraph;
import com.graph.base.CommunityFinder;
import com.graph.dto.ProbabilityModelDto;

public class ProbabilityModelFactory implements Provider{
	private  Integer N;
	private  double  P;
	private  double  M;
	@Override
	public CommunityFinder produce(String dataPath, String fileName) {
		return new ProbabilityModelGraph(N,P,M);
	}
	public ProbabilityModelFactory(ProbabilityModelDto dto) throws Exception {
		if(!dto.isFinishbind()){
			throw new Exception("参数错误!");
		}
		this.N=dto.getN();
		this.M=dto.getM();
		this.P=dto.getP();
	}
	public ProbabilityModelFactory() {
	}
}
